<template>
    <div class="p-2">
        <div class="my-4">
            <el-input placeholder="搜索模板">
                <template #suffix>
                    <el-icon>
                        <el-icon-search />
                    </el-icon>
                </template>
            </el-input>
        </div>
        <div class="grid grid-cols-2 gap-2">
            <el-tooltip v-for="(item, index) in 6" :key="index" content="星球" placement="top">
                <img class='w-40 cursor-pointer' @click="beforeClearTip(json)"
                    src="https://www.kuaitu.cc/uploads/small_1717931782648_40141d1a8d.png" />
            </el-tooltip>
        </div>

    </div>

</template>
<script setup>
const canvasEditor=inject('canvasEditor')
const {data}=await $fetch("https://www.kuaitu.cc/api/templs/7")
const json=data.attributes.json
const beforeClearTip = (json) => {
    canvasEditor.loadJSON(JSON.stringify(json));
}

</script>